package com.painpointcloud.common.util;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class JackLeonRandomUtil {

	public static void main(String[] args) {
		//String p_check_status=getRandomString("未审核|已评估|已通过|重新评估","|");
		//String p_check_status=getRandomString("5|2",2,"|");
		//String p_check_status=getRandomString("40%|10%",2,"|");
		//String p_check_status=getRandomString("南、东|西、北",2,"|");
		String p_check_status=getRandomString("研究生/博士|本科|专科|高中|留学|无信息","|");
		
		System.out.println(p_check_status);
	}
    /**
     * 根据传入的字符串、指定枚举值数目的大小和分割符返回一个随机的枚举值
     * @param str  传入的字符串
     * @param size 枚举值数目
     * @param character 分割符
     * @return 随机的枚举值
     */
	public static String getRandomString(String str,String character){
		List<String> list=new ArrayList<String>();
		String[] strArray=JackLeonStringUtil.splitStringByCharacter(str,character);
		//System.out.println("打印数组大小："+strArray.length);
		for (String string : strArray) {
			list.add(string);
		}
		Random random= new Random();
		int  num=random.nextInt(list.size());
		return list.get(num);
	}
}
